package org.mtmi.ui.controls;

import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;

/**
 * Interface for visual graphic elements.
 * @author jgout
 *
 */
public interface IVisualControl {

	/**
	 * Implementors use this method to render the control.
	 * @param gc
	 */
	void paint(GC gc);
	
	/**
	 * Returns the position of the receiver.
	 * @return a point 
	 */
	Point getLocation();
	
	/**
	 * Returns the size of the receiver as a point.
	 * @return a point where x is the width and y is height.
	 */
	Point getSize();
	
	/**
	 * @return location and size in a rectangle filling parameter or returning new instance.
	 * @param an optionnaly allocated rectangle to be used and returned if desired.
	 */
	Rectangle getBounds( Rectangle r );
}
